import _ from 'lodash';
import def from '../input/def';

export default _.defaultsDeep({
    component: 'jzlPageCascader',
    icon: 'fa fa-stream',
    name: '级联选择',

    box_style: null,
    ele_style: {
        _name: '级联选择',

        label: {
            _ss: {
                "text": '级联选项'
            }
        },
        options: {
            _node: "list",
            _name: "级联列表选项（仅数据）",
            _value: 'options',

            label: {
                _name: "选项Label（仅数据）",
                _node: "text",
                _value: 'label'
            },
            value: {
                _name: "选项值Value（仅数据）",
                _node: "text",
                _value: 'value'
            },
            children: {
                _name: "子选项Children（仅数据）",
                _node: "text",
                _value: 'children'
            }
        }
    },
    setting: {
        sticky: false
    },
    vars: [{
        prop: "model",
        type: "string",
        default: "",
        force: true,
        initType: "static",
        // initPath: "",
        // varName: "",    // page var name
        // emptyDefault: true,
        // api: null,
        // mbCode: null,
        // formCode: null,
        // viewCode: null,
        // itemName: null,
        // apiFilter: {},
        // mapiFilter: {}
    }, {
        prop: "options",
        type: "json",
        default: null,
        force: true,
        initType: "static",
        // initPath: "",
        // varName: "",    // page var name
        // emptyDefault: true,
        // api: null,
        // mbCode: null,
        // formCode: null,
        // viewCode: null,
        // itemName: null,
        // apiFilter: {},
        // mapiFilter: {}

        defaultJson: [{
            label: "选项一",
            value: 1
        }, {
            label: "选项二",
            value: 2
        }]
    }/*, {
        prop: "label",
        type: "string",
        default: "label",
        force: true,
        initType: "static",
        label: "级联选项的显示字段名"
    }, {
        prop: "value",
        type: "string",
        default: "value",
        force: true,
        initType: "static",
        label: "级联选项的取值字段名"
    }, {
        prop: "children",
        type: "string",
        default: "children",
        force: true,
        initType: "static",
        label: "级联的子选项字段名"
    }*/],
    data_mode: 'model-show',
    data_fieldsmap: {},
    data_schema: {},
    data_type: 'static',    // static | dync
    data_dync: {},
    data_static: {}
}, def);
